package com.speed.printer;


import java.io.IOException;
import java.io.PrintWriter;
 
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
import java.io.* ;  

import javax.servlet.* ;  
  
import javax.servlet.http.* ;  
  
public class PrintServlet extends HttpServlet  
  
{  
  
// 初始化  
  
public void init(ServletConfig config) throws ServletException{  
  
}  
  
// 表示处理 get 请求  
  
public void doGet(HttpServletRequest req,HttpServletResponse resp) throws IOException,ServletException{  
    PrintWriter out = resp.getWriter();  
    out.println("<HTML>");  
    out.println("<HEAD>");  
    out.println("<TITLE>HELLO WORLD</TITLE>");  
    out.println("</HEAD>");  
    out.println("<BODY>");  
    out.println("<H1>hello world!!</H1>");  
    out.println("</BODY>");  
    out.println("</HTML>");  
    out.close();  
}  
  
// 处理 post 请求  
  
public void doPost(HttpServletRequest req,HttpServletResponse resp) throws IOException,ServletException{  
  
}  
  
// 销毁  
  
public void destroy(){  
  
}  
  
}   